/*
 * @Description: 项目入口文件
 * @Author: seadon
 * @LastEditors: seadon
 * @Date: 2021-07-06 10:16:41
 * @LastEditTime: 2022-04-02 14:43:40
 */
import setTenant from '@/plugins/setTenant'
import { createApp } from 'vue'
import * as moment from 'moment'
import Antd from 'ant-design-vue'
import store from '@/store'
import { i18n, LocaleEnum } from '@/locales'
import { setupGlobDirectives } from '@/directives'
import App from './app.vue'
import router from './router'
import '@/assets/styles/base.less'
import '@/assets/iconfont/iconfont.css'
// import dayjs from 'dayjs'
// import 'dayjs/locale/zh-cn'

const LOCALE_TO_MOMENT = {
	[LocaleEnum.zh]: 'zh-cn',
	[LocaleEnum.en]: 'en',
	[LocaleEnum.ja]: 'ja',
}
moment.locale(LOCALE_TO_MOMENT[i18n.locale as LocaleEnum])
// dayjs.locale(LOCALE_TO_MOMENT[i18n.locale as LocaleEnum])
;(async () => {
	const app = createApp(App).use(i18n).use(router).use(Antd).use(store)

	setupGlobDirectives(app)
	// try {
	// 	await customInit('/custom/portal.js', app, 'desktop')
	// } finally {
	await setTenant.install(app, 'desktop')
	app.mount('#app')
	// }
})()
